/*
 * Unit test for function getCosts in dominion.c
 *
 * unittest3: unittest3.c dominion.o rngs.o
 *     gcc -o unittest3 -g  unittest3.c dominion.o rngs.o $(CFLAGS)
 */

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

int main() {
    int seed = 1000;
    int numPlayer = 2;
    int k[10] = {adventurer, council_room, feast, gardens, mine
               , remodel, smithy, village, baron, great_hall};
    struct gameState G;

    printf ("TESTING getCosts():\n");
    memset(&G, 23, sizeof(struct gameState));   // clear the game state
    initializeGame(numPlayer, k, seed, &G); // initialize a new game

    int cost[treasure_map+1] = {0,2,5,8,0,3,6,6,5,4,4,5,4,4,3,4,3,5,3,5,3,4,2,5,4,4,4};
    int cost_check;
    int i;
    for(i = 0; i<treasure_map; i++){
        cost_check = getCost(i);
        assert(cost_check == cost[i]);
        if(cost_check == cost[i]){
        	//printf("True\n");
        }
        else{
        	//printf("False\n");
        }
    }

    printf("All tests passed!\n");

    return 0;
}
